import os
import unittest
from cases.Base_Case import BASECASE
from config.config import DATA_PATH
from page.index import IndexPage
from page.住院管理.出院结算.chuyuanjiesuan__page import chuyuanjiesuan
from tools.sjqd_way import read_data_from_excel
class TestChuyuanjiesuan(BASECASE):
    @classmethod
    def setUpClass(cls):
        ap = IndexPage()
        ap.jrym_no1('出院结算')
    @classmethod
    def tearDownClass(cls):
        ap = IndexPage()
        ap.close_all_xxk()
        print("{}执行完毕-------------------------------------------------".format(cls))
    def test_chuyuanjiesuan(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        bp = chuyuanjiesuan()
        bp.choose_bq('全部病区')
        bp.choose_ybzt('全部')
        bp.click_sx_btn()#点击刷新
        bp.click_jshz(name)#选择待结算的患者
        bp.click_jsfy_btn()#点击计算费用
        bp.input_xj()#输入现金
        bp.click_fyjs_btn()#点击费用结算
        bp.close_window_tc()#关闭弹窗
        bp.close_window_tc()#关闭弹窗
        bp.close_window()#关闭窗口
if __name__ == '__main__':
    unittest.main()


